<html>
<head><meta charset="utf-8"><title>how can I test on a big endian platform? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html">how can I test on a big endian platform?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="171897687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20can%20I%20test%20on%20a%20big%20endian%20platform%3F/near/171897687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html#171897687">(Jul 28 2019 at 17:45)</a>:</h4>
<p>In <a href="https://github.com/shepmaster/twox-hash" target="_blank" title="https://github.com/shepmaster/twox-hash">twox-hash</a>, I do some bit-banging work. I'm all but certain that I've screwed something up with respect to big- and little-endian, but I only have access to my x86 little-endian laptop, so I can't test to be sure.</p>
<p>Is there some big-endian emulator setup that I can run Rust code in?</p>



<a name="171898422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20can%20I%20test%20on%20a%20big%20endian%20platform%3F/near/171898422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html#171898422">(Jul 28 2019 at 18:08)</a>:</h4>
<p>if you are using Linux, you can use qemu to run binaries for pretty much any architecture</p>



<a name="171898430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20can%20I%20test%20on%20a%20big%20endian%20platform%3F/near/171898430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html#171898430">(Jul 28 2019 at 18:09)</a>:</h4>
<p>if you are not using Linux I guess you could run it in a VM^^</p>



<a name="171898484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20can%20I%20test%20on%20a%20big%20endian%20platform%3F/near/171898484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html#171898484">(Jul 28 2019 at 18:10)</a>:</h4>
<p>qemu-binfmt is pretty cool: <a href="https://wiki.debian.org/QemuUserEmulation" target="_blank" title="https://wiki.debian.org/QemuUserEmulation">https://wiki.debian.org/QemuUserEmulation</a><br>
with that, you can literally <code>./binary</code> for binaries that have the "wrong" architecture, and it will transparently use qemu to run it (you need the dynamic linker and libs for that architecture obviously, but at least on debian, thanks to multiarch that all is fairly easyto set up)</p>



<a name="171898539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20can%20I%20test%20on%20a%20big%20endian%20platform%3F/near/171898539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html#171898539">(Jul 28 2019 at 18:12)</a>:</h4>
<p>alternatively, you could use Miri :D but unfortunately cross-building libstd is not as easy as it could be (<a href="https://github.com/rust-lang/rust/issues/56443" target="_blank" title="https://github.com/rust-lang/rust/issues/56443">https://github.com/rust-lang/rust/issues/56443</a>)</p>



<a name="171898718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20can%20I%20test%20on%20a%20big%20endian%20platform%3F/near/171898718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html#171898718">(Jul 28 2019 at 18:18)</a>:</h4>
<p>Also see <a href="https://github.com/rust-lang/miri/issues/864" target="_blank" title="https://github.com/rust-lang/miri/issues/864">https://github.com/rust-lang/miri/issues/864</a>, I think it should be possible to make it easier to cross-run things with Miri.</p>



<a name="171900011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20can%20I%20test%20on%20a%20big%20endian%20platform%3F/near/171900011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html#171900011">(Jul 28 2019 at 18:59)</a>:</h4>
<p><a href="https://cfarm.tetaneutral.net/news/" target="_blank" title="https://cfarm.tetaneutral.net/news/">https://cfarm.tetaneutral.net/news/</a> has some big endian targets.</p>



<a name="171900065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20can%20I%20test%20on%20a%20big%20endian%20platform%3F/near/171900065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html#171900065">(Jul 28 2019 at 19:00)</a>:</h4>
<p>MIPS and SPARC most notably.</p>



<a name="171910531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20can%20I%20test%20on%20a%20big%20endian%20platform%3F/near/171910531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20can.20I.20test.20on.20a.20big.20endian.20platform.3F.html#171910531">(Jul 29 2019 at 00:28)</a>:</h4>
<p>I've used <a href="https://github.com/rust-embedded/cross" target="_blank" title="https://github.com/rust-embedded/cross">https://github.com/rust-embedded/cross</a> in CI for things similar to this</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>